﻿using HomagChina.CCHCS.DataTypeModel;
using HomagChina.CCHCS.ViewModels;
using HomagGroup.Base.UI;
using HomagGroup.BaseUI.Router;
using System.Collections.ObjectModel;
using static HomagChina.CCHCS.ProcessResourceInternal;
using static HomagChina.CCHCS.Utility;

namespace HomagChina.CCHCS.Router
{
    public class StatisticsRoute
    {
        public RouterItemDataModel StatisticsRouteModel { get; set; }

        public StatisticsRoute()
        {
            var model = new StatisticsViewModel();
            StatisticsRouteModel = new RouterItemDataModel()
            {
                ID = "Statistics",
                viewLabel = GetLocalText("Statistics"),
                viewName = "Statistics",
                viewModelName = "StatisticsViewModel",
                ViewModel = model,
                keepalive = false,
                userControl = GetUserControlInstance("Statistics"),
                Image = null,
                functionKeyBarItems = new ObservableCollection<FunctionKeyBarItemDataModel>
                {
                   //new FunctionKeyBarItemDataModel() {
                   //    Header =  GetLocalText("Exit"),
                   //    Position = 12,
                   //    Icon = GetIconBrush(Icon.Close, ImageDecoration.Circle),
                   //    Command = new RelayCommand(() => { Application.Current.Shutdown(); })
                   //},
                   new FunctionKeyBarItemDataModel() {
                       Header =  GetLocalText("Error message"),
                       Position = 11,
                       Icon = GetResourceBrush("ErrorMessages"),
                      Command = new RelayCommand(()=>{ NavigateServices.Instance.NavigateTo("ErrorMessage"); })
                   },
                }
            };
            StatisticsRouteModel.userControl.DataContext = model;
        }
    }
}